function answer = calculateOutput(Wvec, filePath)
    [x y z] = loadPointFile(filePath);
    [trainSet testSet expectedOuts expectedTestOuts] = getTestPatterns(x,y,z);
    testSet = horzcat(testSet, ones(rows(testSet), 1)*-1);
    for i=1:rows(testSet)
        currentTest = testSet(i,:)';
        for j=1:cols(Wvec)
            h = Wvec{j}*currentTest;
            currentTest = g(h);
            currentTest = vertcat(currentTest, -1);
        end
        testOutputs(i) = currentTest(1);
    end
    answer = cuadraticError(testOutputs, expectedTestOuts);
end

function ans=g(x)
    beta = 0.25;
    ans = tanh(beta*x);      
end

function [trainingSet testSet expectedOutputs expectedTestOuts] = getTestPatterns(x, y, z)

    [training test] = shufflePoints([x y z],[0.2, 0.8]);
    
    for i=1:rows(training)
        for j=1:cols(training)-1
            trainingSet(i,j) = training(i,j);
        end
        expectedOutputs(i) = training(i,cols(training));
    end

    for i=1:rows(test)
        for j=1:cols(test)-1
            testSet(i,j) = test(i,j);
        end
        expectedTestOuts(i) = test(i,cols(test));
    end
    
    expectedOutputs = expectedOutputs';
    
end